
#generates random integers to  pick "s" or "h" later in the game
import random            
number = random.randint(1, 100)
print(number)

# a to d are integers that define the probability of "s" or "h" being picked
global a
global b
global c
global d
global e
global f
a = 87 
b = 80
c = 70
d = 50
e = 50    #reputation below which I want to hunt to bring my reputation back up back up
f = 200     # The number 'm' must be before i start hunting more
def hunt_choices(round_number, current_food, current_reputation, m, player_reputations):
#To pick "h" or "s"
    

    if current_reputation > 85:          # If my reputation is very high I will slack because others will think i will hunt
        hunt_decisions = ["s" for x in player_reputations]
    elif player_reputations < 20:       #If the other player's reputation is low I will slack because they will probably slack
        hunt_decisions = ["s" for x in player_reputations]
    elif round_number < 4:              # For the first 3 rounds I want to keep my reputation high so I will hunt more
        hunt_decisions = ["h" for x in player_reputations]
    elif current_reputation < e:        # If my reputation is too low I will hunt to bring it back up
        hunt_decisions = ["h" for x in player_reputations]    
    elif player_reputations > 85:       # If the other player's reputation is high I will slack because they will probably hunt
        hunt_decisions = ["s" for x in player_reputations]
    elif player_reputations < 40:       #If the other player's reputation is too low I will slack
        hunt_decisions = ["s" for x in player_reputations]


    # For rounds 4 to 9 I will pick hunt or slack randomly
    # but with a probability defined above by creating a
    # random integer between 1 and 100. If the integer is
    # above certain other integer (a or b above) then I will
    # slack, if it is below this, I will hunt. The probability
    # of hunt is higher if m is below the variable 'f' above.
    elif 3 < round_number < 10:
        if m < f:
            if number <= a:
                hunt_decisions = ["h" for x in player_reputations]
            elif number > a:
                hunt_decisions = ["s" for x in player_reputations]
        elif  number <= (b - round_number):
            hunt_decisions = ["h" for x in player_reputations]
        elif number > (b - round_number):
            hunt_decisions = ["s" for x in player_repuations]
    
    
    # For rounds 10 and onwards I will pick hunt or slack randomly
    # but with a probability defined above by creating a
    # random integer between 1 and 100. If the integer is
    # above certain other integer (c or d above) then I will
    # slack, if it is below this, I will hunt. The probability
    # of hunt is higher if m is below the variable 'f' above. 
    elif round_number > 9:
        if m < f:
            if number <= 70:
                hunt_decisions = ["h" for x in player_reputations]
            elif number > 70:
                hunt_decisions = ["s" for x in player_reputations]
        elif number <= 50:
            hunt_decisions = ["h" for x in player_reputations]
        elif number > 50:
            hunt_decisions = ["s" for x in player_reputations]
            
            
    # If this code for some reason fails, I will hunt.
    else:
        hunt_decisions = ["h" for x in player_reputations]

    return hunt_decisions;

def hunt_outcomes(food_earnings):
    # If my strategey is not working I will
    # lower my variables, causing me to slack more.
    if food_earnings < -20:
        a -= 10
        b -= 10
        c -= 10
        d -= 10

def round_end(award, m, number_hunters):

    f = number_hunters * number_hunters * 0.35
    # This defines what the variable of m must be in order for me to hunt more.
    # here, if it means the hunters hunt roughly a third of the time

    # If there are not many hunters left in the game I will slack more
    # by lowering my variables.
    if number_hunters < 15:
        a -= 20
        b -= 20
        c -= 20
        d -= 20
        # This is to lessen the effect the 'If Statement' regarding my reputation above
        e = 20
